package com.sky.controller.user;

import com.sky.constant.StatusConstant;
import com.sky.result.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController("userShopController")
@RequestMapping("/user/shop")
public class ShopController {

    @Autowired
    private RedisTemplate redisTemplate;

    //获取店铺营业状态
    @GetMapping("/status")
    public Result getShopStatus(){
        Integer status = (Integer)redisTemplate.opsForValue().get(StatusConstant.KEY);
        return Result.success(status);
    }
}
